Skip to content

Improve decodeMessage: safer error handling and modern ethers imports#1017

Open
zeevick10 wants to merge 1 commit intosemaphore-protocol:mainfrom
zeevick10:patch-2
Open

Improve decodeMessage: safer error handling and modern ethers imports#1017
zeevick10 wants to merge 1 commit intosemaphore-protocol:mainfrom
zeevick10:patch-2

Conversation

@zeevick10
Copy link
Copy Markdown

Description

  • Refactored decodeMessage to handle invalid input gracefully (returns null instead of throwing).
  • Updated imports to use the recommended ethers v6+ style.

Copy link
Copy Markdown
Contributor

@JohnGuilding JohnGuilding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for raising this @zeevick10!

One issue with this change is that returning null in all cases swallows the actual errors which is useful information to the developer

Another pattern is to have tryDothing and doThing where one function fails gracefully and the other throws all errors. But not sure we want to do that here.

@vplasencia what are your thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants